<?php
include "class/Classes.php";
include_once "class/HTMLUtil.php";
session_start();
$task = "";
$schoolname = "";
$error = "";
$school = null;

if(empty($_REQUEST['task'])){
	if(empty($_SESSION['task'])) {
		$task = "default";
	} else {
		$task = $_SESSION['task'];
	}
} else {
	$task = $_REQUEST['task'];
	$_SESSION['task'] = $task;
}
if(empty($_SESSION['schoolz'])) {
	$schooldao = new SchoolDAO();
	$school = $schooldao->get(1);
	if(!is_null($school)){
		$schoolname = $school->getName();
		$_SESSION['schoolname'] = $schoolname;
		$_SESSION['school'] = $school;
	}
} else {
	$schoolname = $_SESSION['schoolname'];
}
$school = $_SESSION['school'];

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<link type="text/css" href="smoothness/jquery-ui-1.7.1.custom.css" rel="stylesheet" />
        <script type="text/javascript" src="jquery-1.3.2.min.js"></script>
		<script type="text/javascript" src="jquery-ui-1.7.1.custom.min.js"></script>
		<script type="text/javascript" src="js/common.js"></script>
		<!-- script type="text/javascript" src="script.js"></script -->
        <style type="text/css">@import url('style.css');</style>
		<link type="text/css" href="demos.css" rel="stylesheet" />
		<title><?php echo strtoupper($schoolname); ?> INFORMATION SYSTEM</title>
    </head>
    <body>
    	<div class="container">
    	<div class="block title ui-corner-all"><?php echo $schoolname; ?></div>
    	<div id="page_content ui-corner-all"><?php include "class/controller.php"; ?></div>
		<pre><?php echo $error; ?></pre>
		<form id="hiddenform" action="index.php" method="post">
			<input id="hiddentask" type="hidden" name="task">
			<input type="hidden" id="hiddenid" name="id" />
		</form>
		</div>
    </body>
</html>
